package edu.scau.mis.product.controller;

import edu.scau.mis.product.model.Product;
import edu.scau.mis.product.service.ProductService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@Slf4j
public class ProductController {
    private final ProductService productService;
    @GetMapping("/product/{productId}")
    public Product getProduct(@PathVariable("productId") Long productId){
        log.info("查询商品信息，商品ID：{}", productId);
        return productService.getProductById(productId);
    }
}
